<?php

/**
 * Generated Model class.
 */
class Base_VkApiLogPeer extends Db_Peer implements ISingleton
{

    const ID = '`vk_api_log`.`id`';

    const USER_ID = '`vk_api_log`.`user_id`';

    const URL = '`vk_api_log`.`url`';

    const HTTP_REQUEST = '`vk_api_log`.`http_request`';

    const HTTP_RESPONSE = '`vk_api_log`.`http_response`';

    const DELAY = '`vk_api_log`.`delay`';

    const IS_ERROR = '`vk_api_log`.`is_error`';

    const ERROR = '`vk_api_log`.`error`';

    const DATE = '`vk_api_log`.`date`';

    protected $_name = 'vk_api_log';

    protected $_rowClass = 'VkApiLogRow';

    protected $_dependentTables = array();

    protected $_referenceMap = array();

    private static $_instance = null;

    protected $_metadata = array(
        'id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'vk_api_log',
            'COLUMN_NAME' => 'id',
            'COLUMN_POSITION' => 1,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => true,
            'PRIMARY_POSITION' => 1,
            'IDENTITY' => true
            ),
        'user_id' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'vk_api_log',
            'COLUMN_NAME' => 'user_id',
            'COLUMN_POSITION' => 2,
            'DATA_TYPE' => 'int',
            'DEFAULT' => null,
            'NULLABLE' => true,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => true,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'url' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'vk_api_log',
            'COLUMN_NAME' => 'url',
            'COLUMN_POSITION' => 3,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => '256',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'http_request' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'vk_api_log',
            'COLUMN_NAME' => 'http_request',
            'COLUMN_POSITION' => 4,
            'DATA_TYPE' => 'text',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'http_response' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'vk_api_log',
            'COLUMN_NAME' => 'http_response',
            'COLUMN_POSITION' => 5,
            'DATA_TYPE' => 'text',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'delay' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'vk_api_log',
            'COLUMN_NAME' => 'delay',
            'COLUMN_POSITION' => 6,
            'DATA_TYPE' => 'int',
            'DEFAULT' => '0',
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => true,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'is_error' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'vk_api_log',
            'COLUMN_NAME' => 'is_error',
            'COLUMN_POSITION' => 7,
            'DATA_TYPE' => 'tinyint',
            'DEFAULT' => '0',
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => true,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'error' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'vk_api_log',
            'COLUMN_NAME' => 'error',
            'COLUMN_POSITION' => 8,
            'DATA_TYPE' => 'varchar',
            'DEFAULT' => null,
            'NULLABLE' => false,
            'LENGTH' => '256',
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            ),
        'date' => array(
            'SCHEMA_NAME' => null,
            'TABLE_NAME' => 'vk_api_log',
            'COLUMN_NAME' => 'date',
            'COLUMN_POSITION' => 9,
            'DATA_TYPE' => 'timestamp',
            'DEFAULT' => 'CURRENT_TIMESTAMP',
            'NULLABLE' => false,
            'LENGTH' => null,
            'SCALE' => null,
            'PRECISION' => null,
            'UNSIGNED' => null,
            'PRIMARY' => false,
            'PRIMARY_POSITION' => null,
            'IDENTITY' => false
            )
        );

    /**
     * @return VkApiLogPeer
     */
    public static function getInstance()
    {
        if (!self::$_instance) {
        	self::$_instance = new VkApiLogPeer();
        }
        return self::$_instance;
    }

    /**
     * @return Db_Rowset
     */
    public function findById($id)
    {
        $select = $this->select();
        $select->where('`id` = ?', $id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByUserId($user_id)
    {
        $select = $this->select();
        $select->where('`user_id` = ?', $user_id);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByUrl($url)
    {
        $select = $this->select();
        $select->where('`url` = ?', $url);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByHttpRequest($http_request)
    {
        $select = $this->select();
        $select->where('`http_request` = ?', $http_request);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByHttpResponse($http_response)
    {
        $select = $this->select();
        $select->where('`http_response` = ?', $http_response);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByDelay($delay)
    {
        $select = $this->select();
        $select->where('`delay` = ?', $delay);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByIsError($is_error)
    {
        $select = $this->select();
        $select->where('`is_error` = ?', $is_error);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByError($error)
    {
        $select = $this->select();
        $select->where('`error` = ?', $error);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }

    /**
     * @return Db_Rowset
     */
    public function findByDate($date)
    {
        $select = $this->select();
        $select->where('`date` = ?', $date);
        $rowset = $this->fetchAll($select);
        return $rowset;
    }


}

